
<#include "header.ftl">
  <!-- 内容区域 -->
<div class="tpl-content-wrapper">

   <div class="container-fluid am-cf">
                <div class="row">
                     <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <ol class="am-breadcrumb">
						  <li><a href="${Domain}my" class="am-icon-home">首页</a></li>
						  <li ><a href="${Domain}my/patient/list">患者</a></li>	
						   <li ><a href="${Domain}my/patient/health/${patient.id}">${patient.name}</a></li>		
						  <li class="am-active">添加问卷</li>						  
						</ol>
                    </div>
                  	<#include "../common/return.ftl">
                </div>
</div>
  <div class="row-content am-cf">
  
  

          <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">患者:${patient.name}
                                                                                           性别：<#switch patient.gender>
										           <#case 0> 未知 <#break>
										           <#case 1>男<#break>
										           <#case 2>女<#break>
										           <#default>未知
										 </#switch>
									 年龄：${patient.Age()}
									 身份证：${patient.SimpleNo()}</div>
                                
                            </div>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-line-form"  method="post" action="${Domain}api/access/add" id="access-add" >
                                     <input type="hidden" id="patient" name="patient" value="${patient.id}">
                                  <input type="hidden" id="type" name="type" value="${type}">
                                   
                               
                                     <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">姓名 </label>
                                        <div class="am-u-sm-8 am-u-md-6">
                                            <div class="tngou-show">${patient.name}  </div>                                
                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                           			
                                    <#if type==1>
                                     <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">问卷</label>
                                        <div class="am-u-sm-8 am-u-md-6 am-form-group tpl-table-list-select">
                                          <select data-am-selected="{btnSize: 'sm'}" name="survey" id="survey" >
                                          <#list list as item>
										  <option value="${item.id}" >${item.name}</option> 
							              	</#list>			          
										 </select>

                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    </#if>
                                    
                                     <#if type==2>
                                     <div class="am-form-group">
                                        <label  class="am-u-sm-3 am-u-md-3 am-form-label">疾病</label>
                                        <div class="am-u-sm-8 am-u-md-6 am-form-group tpl-table-list-select">
                                          <select data-am-selected="{btnSize: 'sm',searchBox: 1,maxHeight: 240}" name="cure" id="cure" >
                                          <#list list as item>
										  <option value="${item.id}" >${item.dname}-${item.sname}</option> 
							              	</#list>			          
										 </select>

                                        </div>
                                        <label  class="am-u-sm-1 am-u-md-3"></label>
                                    </div>
                                    </#if>
                                      
                                    
                                    <div class="am-form-group">
                                        <div class="am-u-sm-6 am-u-sm-push-3">
                                            <button type="submit" id="sub" class="am-btn page-header-button tpl-btn-bg-color-success am-btn-block">保存</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
        
         
        
            
   </div>
</div>        
<script type="text/javascript">
  var loading; 
  
   $('#access-add').ajaxForm({
	    beforeSubmit: function(a,f,o) {
	        loading=weui.loading('数据加载中...');
	    },
	    success: function(json) {	    	
	    	if(json.status)
	    	{
	    	  	if(loading)loading.hide();
	    		weui.toast("添加成功！"); 
	    		if($("#id").val()=="") 
	    		$("#id").val(json.msg);
	    		$("#sub").text("编辑");
	    		$('#access-add').attr("action","${Domain}api/patient/linkmanupdate");	
	    		<#if ask.url??>
	    		location.href="${ask.url}";	
	    		</#if>	
	    	}else
	    	{	
	    		if(loading)loading.hide();
	    	    weui.alert(json.msg);  		 
	    	}
	    }
	});
	</script>
<#include "footer.ftl">